import request from '@/config/axios'

// 期刊库 VO
export interface PositiveJournalsVO {
  id: string // 主键
  name: string // 期刊名
  issn: string // ISSN
  district: string // 分区
  subject: string // 期刊类别
  impactFactor: string // 影响因子
}

// 期刊库 API
export const PositiveJournalsApi = {
  // 查询期刊库分页
  getPositiveJournalsPage: async (params: any) => {
    return await request.get({ url: `/core/positive-journals/page`, params })
  },

  // 查询期刊库详情
  getPositiveJournals: async (id: string) => {
    return await request.get({ url: `/core/positive-journals/get?id=` + id })
  },

  // 新增期刊库
  createPositiveJournals: async (data: PositiveJournalsVO) => {
    return await request.post({ url: `/core/positive-journals/create`, data })
  },

  // 修改期刊库
  updatePositiveJournals: async (data: PositiveJournalsVO) => {
    return await request.put({ url: `/core/positive-journals/update`, data })
  },

  // 删除期刊库
  deletePositiveJournals: async (id: string) => {
    return await request.delete({ url: `/core/positive-journals/delete?id=` + id })
  },

  // 导出期刊库 Excel
  exportPositiveJournals: async (params) => {
    return await request.download({ url: `/core/positive-journals/export-excel`, params })
  },

  // 获得期刊库分页(无权限)
  getPositiveJournalsAll: async (params: any) => {
    return await request.get({ url: `/core/positive-journals/page-all`, params })
  },

  // 查询期刊库详情(无权限)
  getPositiveJournalsById: async (id: string) => {
    return await request.get({ url: `/core/positive-journals/get-id?id=` + id })
  },

  // 检测期刊是否为负面期刊
  judgePositiveJournals: async (id: string) => {
    return await request.get({ url: `/core/positive-journals/judge?id=` + id })
  }
}
